#pragma once

#include "Object.h"
#include "StringCore.h"

namespace BaseType
{

class BASE_TYPE_API OType : public Object
{
public:

    RTTIOfClass(OType)

    OType();

    void Sealed();
    bool IsSealed() const;

private:

    uint8_t _sealed;
};

class BASE_TYPE_API OString : public OType
{
public:

    static OString* EmptyString;

    RTTIOfClass(OString)

    OString();
    OString(const String& val, bool autodel);
    OString(const String& value);
    OString(const OString& Other);
    OString(int32_t value);
    ~OString();

    OString* Clone() const;
    bool Equals(Object* Other);

    String ToString();
    float ToFloat();
    int32_t ToInt();
    bool ToBool() const;
    //Rect ToRect();
    //fRect TofRect();
    //Size ToSize();
    //fSize TofSize();
    //Point ToPoint();
    //fPoint TofPoint();

    Color ToColor();

    void SetString(const String& str);

    String operator*() { return _value; }
    operator String() { return _value; }

protected:

    String _value;
};

}

